//
//  CKStudyViewController.m
//  ckjntiku
//
//  Created by Eileen Vivian on 2017/11/22.
//  Copyright © 2017年 Eileen Vivian. All rights reserved.
//

#import "CKStudyViewController.h"

#import "CKAFPViewController.h"
#import "CKCFPViewController.h"


@interface CKStudyViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *subjectTV;
@property (strong, nonatomic) NSArray *myArray;
@property (strong, nonatomic) NSArray *myImagesArray;
@end

@implementation CKStudyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"学习";
     self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithImage:@"member" highImage:@"member" target:self action:@selector(friendsClick)];
    self.myArray=@[@"金融理财师AFP",@"国际金融理财师CFP",@"中级经济师",@"国家理财规划师ChFP",@"基金从业资格AMAC",@"证券从业资格SAC",@"银行从业资格CCBP",@"CFA"];
    self.myImagesArray =@[@"souye_y",@"deal",@"log",@"member",@"set",@"souye_y",@"deal",@"log"];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.myArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ID"];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"ID"];
    }
    cell.textLabel.text = self.myArray[indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:16];
    cell.imageView.image = [UIImage imageNamed:self.myImagesArray[indexPath.row]];
    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0) {
        CKAFPViewController * ckAfpVC = [[CKAFPViewController alloc]init];
        [self.navigationController pushViewController:ckAfpVC animated:YES];
    }else if (indexPath.row == 1){
        CKAFPViewController * ckCfpVC = [[CKAFPViewController alloc]init];
        [self.navigationController pushViewController:ckCfpVC animated:YES];
    }else {
        CKAFPViewController * ckCacheVC = [[CKAFPViewController alloc]init];
        [self.navigationController pushViewController:ckCacheVC animated:YES];
    }
}
-(void)friendsClick{
 
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
